import { defineStore } from "pinia";
import { roleListAll } from "@/api/index"; 
import type { roleData } from "@/api/index";  
import { ref } from "vue";

const roleSetup = ()=>{
    const roleListData = ref<{ items: Array<unknown>; total: number }>(null);
    const roleList = async (page:number,limit:number,searchObj:object)=>{
        let result = await roleListAll({page,limit,searchObj})
        if (result.code==20000) {
            roleListData.value = result.data
        }
    }
    return{ roleListData , roleList }
}
export const roleStore = defineStore('role',roleSetup)
